﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SystemDirectory.Biz;
using SystemDirectory.Common;
using System.Data;
using SystemDirectory.Entity;


namespace SystemDirectory
{
    public partial class ServiceAdd : System.Web.UI.Page
    {
        public static bool IsCheck = false;
        public static Utilities.SearchType IsSearch;
        protected void Page_Load(object sender, EventArgs e)
        {
            //BOService boService = new BOService();
            //SystemDirectory.Entity.Service sv = boService.GetByID(Convert.ToInt32(Request.QueryString["id"].ToString()));
            //ServiceName.Text = sv.ServiceName;
            //description.Text = sv.description;
            //    SubType.Text = sv.SubType;
            //    TextBox2.Text = sv.TextBox2;
            //    serviceStartDate.Text = sv.serviceStartDate;
            //    ServiceStart.Text = sv.ServiceStart;
            //    ServiceEnd.Text = sv.ServiceEnd;
            //    ServiceExtend.Text = sv.ServiceExtend;
            //    ServiceActive.Checked = sv.ServiceActive;
            //    DeptCode.Text = sv.DeptCode;
            //    ServiceType.Text = sv.ServiceType;
            //    DescriptionDelivery.Text = sv.DescriptionDelivery;
            //    ContractCode.Text = sv.ContractCode;
            //    ContractValue.Text = sv.ContractValue;
            //    StagedPayment.Checked = sv.StagedPayment;
            }
        protected void saveService_Click(object sender, EventArgs e)
        {
            Page.Validate("vgroup");
            if (Page.IsValid)
            {
                Service sv = new Service();
                sv.ServiceName = ServiceName.Text;
                sv.serviceshortdescription = serviceshortdescription.Text;
                sv.clientdescription = description.Text;
                sv.ServiceAttendant = Service.Text;
                sv.SubType = SubType.Text;
                sv.Leadcontact = LeadContact.Text;
                sv.serviceStartDate = serviceStartDate.Text;
                sv.ServiceStart = ServiceStart.Text;
                sv.ServiceEnd = ServiceEnd.Text;
                sv.ServiceExtend = ServiceExtend.Text;
                sv.ServiceActive = ServiceActive.Checked;
                sv.ReferenceProcess = DropDownList1.Text;
                sv.DeptCode = DeptCode.Text;
                sv.ServiceType = ServiceType.Text;
                sv.FullDescription = FullDescription.Text;
                sv.DescriptionDelivery = DescriptionDelivery.Text;
                sv.ContractCode = ContractCode.Text;
                sv.ContractValue = ContractValue.Text;
                sv.StagedPayment = StagedPayment.Checked;
                sv.ServiceTimeLimited = ServiceTimeLimited.Text;
                BOService boService = new BOService();
                boService.AddService(sv);
            }
        }

        }
    }


